package com.example.demo01.controllter.test;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Calendar;

/**
 * @author admin
 * @Description 计算器
 * @date 2020-07-27 11:32:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Calculator {

    private Integer num1;

    private Integer num2;

    public int add() {
        return num1 + num2;
    }

    public int sub() {
        return num1 - num2;
    }

    public int divide() {
        return num1 / num2;
    }

    public int multiply() {
        return num1 * num2;
    }

    public static void main(String[] args) {
        Calculator calculator = new Calculator(5, 2);
        System.out.println("calculator.add() = " + calculator.add());
        System.out.println("calculator.divide() = " + calculator.divide());
        System.out.println("calculator.sub() = " + calculator.sub());
        System.out.println("calculator.multiply() = " + calculator.multiply());
    }

}
